<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  <head>
    <meta name="Content-Type" content="text/html; charset=UTF-8" />
<title>Class: Sass::CacheStores::Chain</title>
<link rel="stylesheet" href="style.css" tppabs="http://sass-lang.com/docs/yardoc/css/style.css" type="text/css" media="screen" charset="utf-8" />
<link rel="stylesheet" href="common.css" tppabs="http://sass-lang.com/docs/yardoc/css/common.css" type="text/css" media="screen" charset="utf-8" />

<script type="text/javascript" charset="utf-8">
  relpath = '../..';
  if (relpath != '') relpath += '/';
</script>
<script type="text/javascript" charset="utf-8" src="jquery.js" tppabs="http://sass-lang.com/docs/yardoc/js/jquery.js"></script>
<script type="text/javascript" charset="utf-8" src="app.js" tppabs="http://sass-lang.com/docs/yardoc/js/app.js"></script>

  </head>
  <body>
    <script type="text/javascript" charset="utf-8">
      if (window.top.frames.main) document.body.className = 'frames';
    </script>
    
    <div id="header">
      <div id="menu">
  
    <a href="_index.html" tppabs="http://sass-lang.com/docs/yardoc/_index.html">Index (C)</a> &raquo; 
    <span class='title'><a href="Sass-1.html" tppabs="http://sass-lang.com/docs/yardoc/Sass.html" title="Sass (module)">Sass</a></span> &raquo; <span class='title'><a href="CacheStores.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/CacheStores.html" title="Sass::CacheStores (module)">CacheStores</a></span>
     &raquo; 
    <span class="title">Chain</span>
  
  
  <div class="noframes"><span class="title">(</span><a href="javascript:if(confirm(%27http://sass-lang.com/docs/yardoc/Sass/CacheStores/.  \n\nThis file was not retrieved by Teleport Pro, because the server reports that this file cannot be found.  \n\nDo you want to open it from the server?%27))window.location=%27http://sass-lang.com/docs/yardoc/Sass/CacheStores/.%27" tppabs="http://sass-lang.com/docs/yardoc/Sass/CacheStores/." target="_top">no frames</a><span class="title">)</span></div>
</div>

      <div id="search">
  <a id="class_list_link" href="#">Class List</a>
  <a id="method_list_link" href="#">Method List</a>
  <a id ="file_list_link" href="#">File List</a>
</div>

      <div class="clear"></div>
    </div>
    
    <iframe id="search_frame"></iframe>
    
    <div id="content"><h1>Class: Sass::CacheStores::Chain 
  
  
</h1>

<dl class="box">
  
    <dt class="r1">Inherits:</dt>
    <dd class="r1">
      <span class="inheritName"><a href="Base-2.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/CacheStores/Base.html" title="Sass::CacheStores::Base (class)">Base</a></span>
      
        <ul class="fullTree">
          <li>Object</li>
          
            <li class="next"><a href="Base-2.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/CacheStores/Base.html" title="Sass::CacheStores::Base (class)">Base</a></li>
          
            <li class="next">Sass::CacheStores::Chain</li>
          
        </ul>
        <a href="#" class="inheritanceTree">show all</a>
      
      </dd>
    
  
  
    
  
    
  
  
    <dt class="r2 last">Defined in:</dt>
    <dd class="r2 last">/var/www/sass-pages/.sass/lib/sass/cache_stores/chain.rb</dd>
  
</dl>
<div class="clear"></div>

<h2>Overview</h2><div class="docstring">
  <div class="discussion">
    <p>A meta-cache that chains multiple caches together. Specifically:</p>

<ul>
<li>All <code>#store</code>s are passed to all caches.</li>

<li><code>#retrieve</code>s are passed to each cache until one has a hit.</li>

<li>When one cache has a hit, the value is <code>#store</code>d in all earlier caches.</li>
</ul>

  </div>
</div>
<div class="tags">
  
</div>

  
  
  
  

  <h2>Instance Method Summary</h2>

  <ul class="summary">
    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#initialize-instance_method" title="#initialize (instance method)">- (Chain) <strong>initialize</strong>(*caches) </a>
    

    
  </span>
  
    <span class="note title constructor">constructor</span>
  
  
  
  
  

  
    <span class="summary_desc">Create a new cache chaining the given caches.</span>
  
</li>

    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#retrieve-instance_method" title="#retrieve (instance method)">- <strong>retrieve</strong>(key, sha) </a>
    

    
  </span>
  
  
  
  
  

  
    <span class="summary_desc"></span>
  
</li>

    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#store-instance_method" title="#store (instance method)">- <strong>store</strong>(key, sha, obj) </a>
    

    
  </span>
  
  
  
  
  

  
    <span class="summary_desc"></span>
  
</li>

    
  </ul>

  
  
  
  
  
  <h3 class="inherited">Methods inherited from <a href="Base-2.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/CacheStores/Base.html" title="Sass::CacheStores::Base (class)">Base</a></h3>
  <p class="inherited"><a href="Base-2.html#_retrieve-instance_method" tppabs="http://sass-lang.com/docs/yardoc/Sass/CacheStores/Base.html#_retrieve-instance_method" title="Sass::CacheStores::Base#_retrieve (method)">#_retrieve</a>, <a href="Base-2.html#_store-instance_method" tppabs="http://sass-lang.com/docs/yardoc/Sass/CacheStores/Base.html#_store-instance_method" title="Sass::CacheStores::Base#_store (method)">#_store</a>, <a href="Base-2.html#key-instance_method" tppabs="http://sass-lang.com/docs/yardoc/Sass/CacheStores/Base.html#key-instance_method" title="Sass::CacheStores::Base#key (method)">#key</a></p>
<div id="constructor_details" class="method_details_list">
  <h2>Constructor Details</h2>
  
    <div class="method_details first">
  <p class="signature first" id="initialize-instance_method">
  
    - (<tt><a href="" title="Sass::CacheStores::Chain (class)">Chain</a></tt>) <strong>initialize</strong>(*caches) 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>Create a new cache chaining the given caches.</p>

  </div>
</div>
<div class="tags">
  <h3>Parameters:</h3>
<ul class="param">
  
    <li>
      
        <span class='type'>(<tt>Array&lt;<a href="Base-2.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/CacheStores/Base.html" title="Sass::CacheStores::Base (class)">Sass::CacheStores::Base</a>&gt;</tt>)</span>
      
      
        <span class='name'>caches</span>
      
      
      
        &mdash;
        The caches to chain.
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


13
14
15</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/cache_stores/chain.rb', line 13</span>

def initialize(*caches)
  @caches = caches
end</pre>
    </td>
  </tr>
</table>
</div>
  
</div>


  <div id="instance_method_details" class="method_details_list">
    <h2>Instance Method Details</h2>
    
    
      <div class="method_details first">
  <p class="signature first" id="retrieve-instance_method">
  
    - <strong>retrieve</strong>(key, sha) 
  

  
</p><div class="docstring">
  <div class="discussion">
    

  </div>
</div>
<div class="tags">
  
  <h3>See Also:</h3>
  <ul class="see">
    
      <li><a href="Base-2.html#retrieve-instance_method" tppabs="http://sass-lang.com/docs/yardoc/Sass/CacheStores/Base.html#retrieve-instance_method" title="Sass::CacheStores::Base#retrieve (method)">Base#retrieve</a></li>
    
  </ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


23
24
25
26
27
28
29
30</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/cache_stores/chain.rb', line 23</span>

def retrieve(key, sha)
  @caches.each_with_index do |c, i|
    next unless obj = c.retrieve(key, sha)
    @caches[0...i].each {|prev| prev.store(key, sha, obj)}
    return obj
  end
  nil
end</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="store-instance_method">
  
    - <strong>store</strong>(key, sha, obj) 
  

  
</p><div class="docstring">
  <div class="discussion">
    

  </div>
</div>
<div class="tags">
  
  <h3>See Also:</h3>
  <ul class="see">
    
      <li><a href="Base-2.html#store-instance_method" tppabs="http://sass-lang.com/docs/yardoc/Sass/CacheStores/Base.html#store-instance_method" title="Sass::CacheStores::Base#store (method)">Base#store</a></li>
    
  </ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


18
19
20</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/cache_stores/chain.rb', line 18</span>

def store(key, sha, obj)
  @caches.each {|c| c.store(key, sha, obj)}
end</pre>
    </td>
  </tr>
</table>
</div>
    
  </div>

</div>
    
    <div id="footer">
  Generated on Fri Mar  8 20:33:44 2013 by 
  <a href="javascript:if(confirm(%27http://yardoc.org/  \n\nThis file was not retrieved by Teleport Pro, because it is addressed on a domain or path outside the boundaries set for its Starting Address.  \n\nDo you want to open it from the server?%27))window.location=%27http://yardoc.org/%27" tppabs="http://yardoc.org/" title="Yay! A Ruby Documentation Tool">yard</a>
  0.5.3 (ruby-1.8.7).
</div>


  <script type="text/javascript">
  var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
  document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
  </script>
  <script type="text/javascript">
  try {
  var pageTracker = _gat._getTracker("UA-535380-8");
  pageTracker._trackPageview();
  } catch(err) {}</script>


  </body>
</html>